<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/9
  Time: 19:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>根据流水号查询模态框</title>
</head>
<body>
        <div class="modal-header">
            <button class="close" data-dismiss="modal">返回</button>
        </div>
        <div class="modal-body">
            <div class="row">
                <div class="col-md-5 col-md-offset-4"><h2>入库申请登记审核</h2></div>
            </div>
            <br>
            <div class="row">
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>申请单编号:</td>
                            <td><input type="text" id="gatherIdzhdmodalall" readonly name="gatherId" class="form-control"  style="outline: none;border:none"></td>
                        </tr>
                        <tr>
                            <td>入库人:</td>
                            <td><input type="text" id="storerzhdmodalall" readonly name="storer" class="form-control" required style="outline: none;border:none;border-bottom:black 1px dashed"></td>
                        </tr>
                    </table>
                </div>
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>入库理由:</td>
                            <td>
                                <select class="form-control" id="reasonzhdsmodalall">
                                    <option value="R001-1">生产入库</option>
                                    <option value="R001-2">库存初始</option>
                                    <option value="R001-3">赠送</option>
                                    <option value="R001-4">内部借领</option>
                                    <option value="R001-5">其他借领</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <br>
            <br>
            <div style="height:40%">
                <table  class="table" id="addgoodscpallall">
                </table>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <table id="gatherdetailstableallall">
                        <tr>
                            <td>总件数:</td>
                            <td><input type="text" name="amountSum"   id="amountSumahtermodalall" class="form-control" readonly style="outline: none; border:none;"></td>
                        </tr>
                        <tr>
                            <td>登记人:</td>
                            <td><input type="text" name="register" id="registerzhdmodalall"  class="form-control" required style="outline: none; border:none; border-bottom:black 1px dashed"></td>
                        </tr>
                        <tr>
                            <td>审核人:</td>
                            <td><input type="text" name="checker" id="checkerzhdmodalall" value="${username}"  class="form-control" required style="outline: none; border:none; border-bottom:black 1px dashed"></td>
                        </tr>
                    </table>
                </div>
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>总金额:</td>
                            <td><input type="text" name="costPriceSum" id="costPriceSumzhdmodalall"  class="form-control" readonly style="outline: none; border:none;background-color: white"></td>
                        </tr>
                        <tr>
                            <td>登记时间:</td>
                            <td><input type="text" name="registerTime" required  id="querygathertimesmodalall"  readonly style="outline: none; border:none;"></td>
                        </tr>
                        <tr>
                            <td>审核时间:</td>
                            <td><input type="text" name="checkTime" required id="querygathercheckTimeall"  readonly style="outline: none; border:none;"></td>
                        </tr>
                    </table>
                </div>
            </div>
            <br>
            <div>
                <div class="form-group">
                    <label for="updatemessage-textgoodsmodalall" class="control-label">备注:</label>
                    <textarea class="form-control" readonly  name="remark" id="updatemessage-textgoodsmodalall" style="width:860px;height:200px"></textarea>
                </div>
            </div>
        </div>

        <script>
            //加载数据
            $(function () {
                //获取流水号
                var gatherId='${param.gatherId}'
                $.post("queryGaherBygatherId.action",{"gatherId":gatherId},function (data) {
                    //加载入库数据
                    $("#gatherIdzhdmodalall").val(data.gatherId)
                    $("#storerzhdmodalall").val(data.storer)
                    $("#reasonzhdsmodalall").val(data.reason)
                    $("#amountSumahtermodalall").val(data.amountSum)
                    $("#registerzhdmodalall").val(data.register)
                    $("#costPriceSumzhdmodalall").val(data.costPriceSum)
                    $("#querygathercheckTimeall").val(data.checkTime)
                    $("#querygathertimesmodalall").val(data.registerTime)
                    $("#updatemessage-textgoodsmodalall").val(data.remark)

                    //获取明细表的值
                    var datas=data.gatherDetails;
                    var arr=[]
                    for(var i=0;i<datas.length;i++){
                        arr.push(datas[i])
                    }
                    //赋值给表格
                    $("#addgoodscpallall").bootstrapTable("load",arr)
                },"json")

                $("#addgoodscpallall").bootstrapTable({
                    contentType: "application/x-www-form-urlencoded", //如果用tomcat就要写这个
                    striped: true,//是否显示隔行变色
                    cache: false,//是否缓存
                    pagination: false,//是否显示分页
                    sortable: false,//是否显示排序
                    clickToSelect: true,//是否启用点击选中行
                    uniqueId:"id",//每一行的唯一标识，一般为主键列
                    columns:[
                        {
                            field:"productName",
                            title:"产品名称",
                        },
                        {
                            field:"productId",
                            title:"产品编号",
                        },
                        {
                            field:"productDescribe",
                            title:"描述",
                        },
                        {
                            field:"amount",
                            title:"数量",
                        },
                        {
                            field:"amountUnit",
                            title:"单位",
                        },
                        {
                            field:"costPrice",
                            title:"成本单价(元)",
                        },
                        {
                            field:"subtotal",
                            title:"小计",
                        }
                    ]

                })
            })
        </script>
</body>
</html>
